package com.gxuwz.Market.business.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.Market.business.dao.ServiceRecordDAO;
import com.gxuwz.Market.business.entity.ServiceRecord;
import com.gxuwz.core.pagination.Result;

@Service("serviceRecordService")
public class ServiceRecordImpl implements IServiceRecordService {
	@Autowired
	private ServiceRecordDAO serviceRecordDAO;

	@Override
	public ServiceRecord findById(int id) {
		// TODO Auto-generated method stub
		return serviceRecordDAO.findById(id);
	}

	@Override
	public List<ServiceRecord> findAll() {
		// TODO Auto-generated method stub
		return serviceRecordDAO.findAll();
	}

	@Override
	public Result<ServiceRecord> find(ServiceRecord serviceRecord, int page, int size) {
		// TODO Auto-generated method stub
		return serviceRecordDAO.find(serviceRecord, page, size);
	}

	@Override
	public List<ServiceRecord> findByProperty(String property, String value) {
		// TODO Auto-generated method stub
		return serviceRecordDAO.findByProperty(property, value);
	}

	@Override
	public void add(ServiceRecord serviceRecord) {
		// TODO Auto-generated method stub
		serviceRecordDAO.save(serviceRecord);

	}

	@Override
	public void delete(int id) {
		// TODO Auto-generated method stub
		ServiceRecord serviceRecord = serviceRecordDAO.findById(id);
		serviceRecordDAO.remove(serviceRecord);

	}

	@Override
	public void update(ServiceRecord serviceRecord) {
		// TODO Auto-generated method stub
		serviceRecordDAO.update(serviceRecord);

	}

}
